import { http as request, toast } from '@uview-plus'



// 获取图形验证码
export const getCaptcha = () => {
    return request({
        url: '/verifyhub/generate_captcha/',
        method: 'GET',
        responseType: 'arraybuffer'
    })
}

// 验证图形验证码
export const validateCaptcha = (data) => {
    return request({
        url: '/verifyhub/validate_image_captcha/',
        method: 'POST',
        data
    })
}

// 发送短信验证码
export const sendSmsCode = (data) => {
    return request({
        url: '/verifyhub/send_code/',
        method: 'POST',
        data
    })
}

// 验证码登录
export const loginByCode = (data) => {
    return request({
        url: '/user/login/code',
        method: 'POST',
        data
    })
}
// 验证码登录
export const login = (data) => {
    return request({
        url: '/user/login/',
        method: 'POST',
        data
    })
} 